package cn.mw.cmdb.entity;

import cn.mw.components.mongodb.anno.CMDBProperty;
import cn.mw.components.mongodb.anno.CMDBRelations;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.data.mongodb.core.mapping.Document;

import java.util.Map;

@Data
@Document("mw_cmdbmd_instance")
public class InstanceCountTrendDto extends InstanceInfo{

    private int count;
    private String year;
    private String month;
    private String day;
    private String hour;
    private Map<String,Object> groupDate;

    @CMDBProperty(searchType = PropertyTypeString.ID, keywordSearch = true)
    @CMDBRelations(targetClass = ModelInfo.class, targetField = "modelName", localField = "modelId", foreignField = "_id")
    @Schema(description = "模型名称")
    private String modelName;

    @CMDBProperty(searchType = PropertyTypeString.ID, keywordSearch = true)
    @CMDBRelations(targetClass = ModelInfo.class, targetField = "modelType", localField = "modelId", foreignField = "_id")
    @Schema(description = "模型类型")
    private String modelType;

    @CMDBProperty(searchType = PropertyTypeString.ID, isShow = true, keywordSearch = true)
    @CMDBRelations(targetClass = ModelVendorInfo.class, targetField = "vendorCN", localField = "brandId", foreignField = "_id")
    @Schema(description = "厂商")
    private String vendor;
}
